<html>
	<head>
			<meta charset="utf-8"/>
			<title>UPLOAD CSV</title>
	</head>
	<body>
		UPLOAD CSV
		<form action="" enctype="multipart/form-data">
			name<input type="text" name="image[]" multiple value="hieutot">
			<br>
			images <input type="file" name="image[]" multiple>
			<br>
			<button type="submit">Submit</button>
		</form>
	</body>

	<script>
		var form = document.querySelector('form');
		var request = new XMLHttpRequest();

		request.upload.addEventListener("progress", function(e){
			console.log(e.loaded / e.total * 100 + ' percent');
		}, false);

		request.addEventListener("load", function(e) {
			console.log(JSON.parse(e.target.responseText));
		}, false);

		form.addEventListener('submit', function(e){
			e.preventDefault();

			var formData = new FormData(form);

			request.open('post', 'doUploadCsv');
			request.send(formData);
		}, false);

	</script>
</html>